<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $this->config->item('charset');?>">
        <title>增加文章</title>
        <style type="text/css">
            <!--
            body { background-image: url(<?php echo base_url();?>public/images/allbg.gif); }
            .multipic {
                border: 1px dashed #FC6;
            }
            .albCt {
                border-bottom: 1px dashed #FC0;
                margin-bottom: 10px;
                padding-bottom:10px;
            }
            .albCt img{
                cursor:pointer;
            }
            -->
        </style>
        <link href="<?php echo base_url();?>public/css/base.css" rel="stylesheet" type="text/css">
        <link href='<?php echo base_url();?>public/css/tb-box.css' rel='stylesheet' type='text/css' />
        <script lang='javascript' src='<?php echo base_url();?>public/js/kindeditor-4.1.2/kindeditor.js'></script>
        <script lang='javascript' src='<?php echo base_url();?>public/js/kindeditor-4.1.2/lang/zh_CN.js'></script>
        <script language="javascript">
            <!--
            var swfu = null;
            var arctype = 'article';
            function checkSubmit()
            {
                if(document.form1.title.value=='')
                    {
                    alert('文章标题不能为空！');
                    return false;
                }
                if(document.form1.typeid.value==0)
                    {
                    alert('请选择文章的分类！');
                    return false;
                }
            }

            var editor;
            KindEditor.ready(function(K) {
                    editor = K.create('#content');
            });



            KindEditor.ready(function(K) {
                    var editor = K.editor({
                            allowFileManager : true
                    });
                    K('#image1').click(function() {
                            editor.loadPlugin('image', function() {
                                    editor.plugin.imageDialog({
                                            imageUrl : K('#url1').val(),
                                            clickFn : function(url, title, width, height, border, align) {
                                                K('#url1').val(url);
                                                editor.hideDialog();
                                            }
                                    });
                            });
                    });
            });




            -->
        </script>
    </head>
    <body topmargin="8">
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="60%" height="30"><IMG height=14 src="<?php echo base_url();?>public/images/book1.gif" width=20>&nbsp;<a href=""><u>文章列表</u></a> &gt;&gt; 发布文章</td>
                <td width="30%" align='right'>&nbsp; <a href="<?php echo site_url("admin/sort")?>">[<u>分类管理</u>]</a> </td>
            </tr>
        </table>





        <form name="form1" action="<?php echo site_url("admin/archivesuser/save"); ?>" method="post" onSubmit="return checkSubmit()">
            <input type="hidden" name="channelid" value="" />
            <input type="hidden" name="dopost" value="add" />
            <table width="98%"  border="0" align="center" cellpadding="2" cellspacing="2" id="needset" style="border:1px solid #cfcfcf;background:#ffffff;">
                <tr>
                    <td height="24" colspan="5" class="bline">
                        <table width="800" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="90">&nbsp;文章标题：</td>
                                <td width='408'><input name="title" type="text" id="title" value="" style="width:388px" /></td>
                                <td width="90">&nbsp;</td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                        </table></td>
                </tr>
            <!--    <tr>
                    <td height="24" colspan="5" class="bline">
                        <table width="800" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td  width="90">&nbsp;自定义属性：</td>
                                <td align="left">

                                    <?php

                                        foreach ($arcatt_all_list->result() as $arcatt)
                                        {

                                            echo "<input class='np' type='checkbox' name='flags[]' id='flags{$arcatt->att}' value='{$arcatt->att}' />{$arcatt->attname}.{$arcatt->att}";

                                        }

                                    ?>


                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
-->
             <!--   <tr>
                    <td width="400%" height="24" colspan="2" class="bline">
                        <table width="800" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="90">&nbsp;缩略图：</td>
                                <td width="408">  <input name="url1" type="text" id="url1" style="width:260px" value="" size="16"/><input type="button" id="image1" value="选择图片" /></td>
                                <td>&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
-->
                <tr>
                    <td height="24" colspan="5" class="bline">
                        <table width="800" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <!--  <td width="90">&nbsp;文章来源：</td>
                                <td width="240">
                                    <input name="source" type="text" id="source" style="width:200px" value="" size="16"/>
                                </td>-->
                                <td width="90">作　者：</td>
                                <td>
                                    <input name="writer" readonly="readonly" type="text" id="writer" style="width:220px" value="<?PHP echo $this->_admin->userid;?>"/>
<input name="backurl"  type="hidden" id="backurl"   value="<?php echo $_SERVER['HTTP_REFERER'];?>"/>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td height="24" colspan="5" class="bline">
                        <table width="800" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="90">&nbsp;文章分类：</td>
                                <td>
                                    <select name='typeid' id='typeid'>
                                        <option value='0'>请选择栏目...</option>
                                        <?php
                                            if ($treelist->num_rows() > 0)
                                            {
                                                foreach ($treelist->result() as $row)
                                                {
                                                    $s_count=count(explode('-',$row->path));
                                                    $s_length='';
                                                    for($i=1;$i<$s_count;$i++)
                                                    {
                                                        $s_length=$s_length.'─';
                                                    }
                                                    $s_select='';
                                                    if($row->id==$this->input->get('typeid',true))
                                                    {
                                                        $s_select='selected=\'selected\'';
														  echo " <option value='".$row->id."' ".$s_select.">".$s_length.$row->name."</option>";
                                                    }
                                                  
                                                }
                                            }
                                        ?>

                                    </select>
                                </td>
                            </tr>
                        </table></td>
                </tr>


                <tr>
                    <td height="24" colspan="5" class="bline">
                        <table width="800" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="90">&nbsp;内容摘要：</td>
                                <td width="449"><textarea name="description" rows="5" id="description" style="width:80%;height:50px"></textarea></td>
                                <td width="261">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td height="24" colspan="5" class="bline">
                        <table width="800" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td width="90">&nbsp;发布时间：</td>
                                <td>   <input name="sendtime" type="text" id="sendtime" style="width:160px" value="<?php echo date("Y-m-d H:i:s");?>" size="26"/>


                                </td>
                            </tr>
                        </table></td>
                </tr>
                <tr>   
                    <td colspan="2"></td>
                </tr>

                <tr>
                    <td height="28" colspan="2" bgcolor="#F9FCEF" class="bline2">
                        <div style='float:left;line-height:28px;'>&nbsp;<strong>文章内容：</strong></div>
                    </td>
                </tr>


                <tr>
                    <td width="100%" id="arcBody" >
                        <textarea name="content" rows="5" id="content" style="width:700px;height:300px;"></textarea>
                    </td>
                    <td width="255" align="center" valign="top" bgcolor="#FFFFCC" id="mPic" style="display:none">
                    </td>
                </tr>






            </table>






            <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#F9FCEF" style="border:1px solid #cfcfcf;border-top:none;">
                <tr height="35">
                    <td width="17%">&nbsp;</td>
                    <td width="83%"><input name="imageField" type="image" src="<?php echo base_url();?>public/images/button_save.gif" width="60" height="22" class="np" border="0"  style="cursor:pointer;"/>
                        <img src="<?php echo base_url();?>public/images/button_reset.gif" width="60" height="22" border="0" onClick="location.reload();" style="cursor:pointer; "/>
                    </td>
                </tr>
            </table>
        </form>
        <div id="__tmpbody" style="display:none"></div>
        <script language='javascript'>InitPage();</script>
    </body>
</html>